package stu.wingsmaker.art.subway;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.shapes.Shape;
import android.net.Uri;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;

public class MoveObject extends View{
    int X,Y,Height,Width;
    private MovingView MU;
    
    public MoveObject(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }
    
    public MoveObject(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
    }
    
//    public void setSelectedImage(String ImagePath){
//        Bitmap Image = BitmapFactory.decodeFile(ImagePath);
//        MU=new MovingView(Image);
//        invalidate();
//    }

    public void setSelectedImage(Bitmap Image){
        MU=new MovingView(Image);
        invalidate();
    }
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // TODO Auto-generated method stub
        MU.TouchProcess(event);
        invalidate();
        return (true);
    }
    
    @Override
    public void draw(Canvas canvas) {
        // TODO Auto-generated method stub
        canvas.drawBitmap(MU.getImage(), null,  MU.getRect(), null);
        super.draw(canvas);
    }
}